package com.qf.utils;

import java.io.IOException;
import java.util.Properties;

/**
 * 加载配置文件的工具类
 */
public class LoadConfigUtils {

    private static Properties properties;

    public static void initConfigFile(String fileName) {
        properties = new Properties();
        try {
            properties.load(LoadConfigUtils.class.getClassLoader().getResourceAsStream(fileName));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static String getConfigItem(String itemName) {
        return properties.getProperty(itemName);
    }
}
